#include <stdio.h>
#include <unistd.h>


//守护进程族
//exec
/*int main()
{

	int ret;
	ret = execl("/bin/ls","ls", "l","a", "/etc",NULL);
	if(ret < 0)
	{
		perror("exelc");
	}	
}*/


/*int main()
{

	int ret;
	ret = execlp("ls", "ls", "a", "l","/etc",NULL);
	if(ret < 0)
	{
		perror("execlp");
	}
}*/


int main()
{

	//函数原型
	//int execvp(const char *file, char *const argv[]);
	//把后面的参数换成封装成指针

	int main()
	{
		int ret;
		char *argv[] = {"ls", "-a", "-l", "/etc", NULL};
		ret = execvp("ls",argv);
		if(ret < 0)
		{
			perror("execvp");
		}
	}

}





















